package com.zhuhjay.chat.client.handler;

import com.zhuhjay.chat.message.GroupJoinResponseMessage;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;

/**
 * 加入群组响应消息处理器
 * @author ZhuHJay
 * @date 2023/3/9 11:38
 */
@ChannelHandler.Sharable
public class GroupJoinResponseMessageHandler extends AbstractResponseMessageHandler<GroupJoinResponseMessage> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, GroupJoinResponseMessage msg) throws Exception {
        if (msg.isSuccess()) {
            System.out.printf("\rTIP: %s%n>>> ", msg.getReason());
        } else {
            System.out.printf("\rERROR: %s%n>>> ", msg.getReason());
        }
    }
}
